package day1120_1;
import javax.swing.*;
import java.awt.*;

public class W2 {
    public static void main(String[] args) {
        JFrame  win=new JFrame("黄金矿工");//1.窗口对象
        JPanel  p=new JPanel();
        //会采用一个默认的布局(流式布局:从左到右排列)创建布局对象(一会儿编写)，
        BorderLayout bLay=new BorderLayout();
        p.setLayout(bLay);

        JButton  btn=new JButton("登录");
        p.add( BorderLayout.WEST,  btn);//将按钮添加到面板中  (给面板中粘贴一个按钮)
        p.add( BorderLayout.EAST,  new JButton("取消") );
        p.add(BorderLayout.NORTH, new JButton("北"));
        p.add(BorderLayout.SOUTH, new JButton("南"));
        win.add(p);//将面板添加到窗口中(黑板挂到墙上)
        win.setSize(900,800);
        win.setVisible(true);
    }
}
